package com.ruoyi.project.lely.bean.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import javax.validation.constraints.NotEmpty;
import org.hibernate.validator.constraints.Length;

/**
 * 广告
 *
 * @author luoyong
 */
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName(value = "`ly_ad`", autoResultMap = true)
public class LyAd {


    @ApiModelProperty("ID")
    @TableId("id")
    private Long id;


    @Length(max = 63, message = "广告标题长度不能超过63位")
    @NotEmpty
    @ApiModelProperty("广告标题")
    @TableField(value = "`name`")
    private String name;


    @Length(max = 255, message = "所广告的商品页面或者活动页面链接地址长度不能超过255位")
    @NotEmpty
    @ApiModelProperty("所广告的商品页面或者活动页面链接地址")
    @TableField(value = "`link`")
    private String link;


    @Length(max = 255, message = "广告宣传图片长度不能超过255位")
    @NotEmpty
    @ApiModelProperty("广告宣传图片")
    @TableField(value = "`url`")
    private String url;


    @ApiModelProperty("广告位置：1则是首页")
    @TableField(value = "`position`")
    private Integer position;


    @Length(max = 255, message = "活动内容长度不能超过255位")
    @ApiModelProperty("活动内容")
    @TableField(value = "`content`")
    private String content;


    @ApiModelProperty("广告开始时间")
    @TableField(value = "`start_time`")
    private LocalDateTime startTime;


    @ApiModelProperty("广告结束时间")
    @TableField(value = "`end_time`")
    private LocalDateTime endTime;


    @ApiModelProperty("是否启动")
    @TableField(value = "`enabled`")
    private Integer enabled;


    @ApiModelProperty("创建时间")
    @TableField(value = "`create_time`", fill = FieldFill.INSERT)
    private LocalDateTime createTime;


    @ApiModelProperty("更新时间")
    @TableField(value = "`update_time`", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


    @ApiModelProperty("逻辑删除")
    @TableField(value = "`deleted`", fill = FieldFill.INSERT)
    private Integer deleted;

}
